import type { AuditFields } from "../audit-fields";
import type { MenuInfo } from "./menu";
import type { RoleInfo } from "./role";

export enum UserStatus {
  正常 = 0,
  锁定 = 1,
  禁用 = 2,
  待审核 = 9,
  过期 = 999,
}

interface SysUser extends AuditFields {
  uid: string;
  pwd: string;
  name: string;
  email?: string;
  status: UserStatus;
  loginTimes: number;
  currentRoleId?: number;
}

interface UserInfo extends SysUser {
  roles?: Array<RoleInfo>;
  menus?: Array<MenuInfo>;

  roleIds?: Array<number>;
  menuIds?: Array<number>;

  dimensions?: Array<Record<string, string>>;

  currentRole?: RoleInfo;
  currentRoleName?: string;
}

export type { SysUser, UserInfo };
